package com.westa.smallshop.setting;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.westa.smallshop.R;
import com.westa.smallshop.common.BaseActivity;
import com.westa.smallshop.util.ActivityUtils;

/**
 * Created by cy on 11/6/16.
 */

public class SettingActivity extends BaseActivity {

    public static void startActivity(Activity activity) {

        Intent intent = new Intent(activity, SettingActivity.class);
        activity.startActivity(intent);

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);

        SettingFragment fragment = (SettingFragment) getSupportFragmentManager()
                .findFragmentById(R.id.fragment_layout);

        if (fragment == null) {
            fragment = SettingFragment.newInstance();
            ActivityUtils.addFragmentToActivity(getSupportFragmentManager(),
                    fragment, R.id.fragment_layout);
        }
    }
}
